<template>
	<view class="content">
		<view style="font-size: 34upx;color: #555555;line-height: 50upx;">{{ type[index] }}描述:</view>
		<view>{{ content }}</view>
		<view style="font-size: 34upx;color: #555555;line-height: 50upx;">{{ type[index] }}地址:</view>
		<view>{{ title }}</view>
		<view style="font-size: 34upx;color: #555555;line-height: 50upx;">{{ type[index] }}照片:</view>
		<view class="imglist"><image @tap="yulan(val)" style="width: 200upx;height: 200upx;margin: 20upx;" :src="val" v-for="val of imageList" mode="" :key="val"></image></view>
	</view>
</template>

<script>
import CHONG from '../../static/js/function.js';
import { mapState, mapMutations } from 'vuex';
export default {
	computed: mapState(['URL']),
	data() {
		// 初始值
		return {
			imageList: [],
			content: '',
			title:'',
			type: ['曝光', '举报','流浪犬'],
			index:0,
		};
	},
	methods: {
		getList(e, t) {
			uni.request({
				url: this.URL + 'exposedDetail',
				data: { id: e, type: t },
				success: res => {
					console.log('详情');
					console.log(res.data.data[0]);
					let json = res.data.data[0];
					this.content = json.content;
					this.title = json.title;
					this.imageList = json.filepath.split(',')
				}
			});
		},
		yulan(e){
			uni.previewImage({
				current:e,
				urls:this.imageList,
				success:()=>{
					console.log("ddd");
				}
			})
		}
	},
	onLoad(e) {
		console.log(e.id, e.type);
		this.index = e.type
		this.getList(e.id, e.type);
	}
};
</script>

<style lang="scss">
.content {
	font-size: 26upx;
	padding: 20upx;
}
</style>
